n, s = map(int, input().split())
board = []
for _ in range(n):
    board.append(list(map(int, input().split())))
board.sort(key=lambda x: x[1], reverse=True)  # 按照需要升级次数排序 升级次数少的放在栈顶即列表索引大的位置
all_costs = 0  # 挨个升级所有元素的总花费
p_times = 0  # 一起升级的次数
for i in range(n):
    all_costs += board[i][0]
result = 0  # 总花费
while all_costs > s and board:  # 一起升级花费小于单独为剩下所有人花费
    top_elem = board.pop()  # 弹出最小元素
    all_costs -= top_elem[0]  # 挨个升级所有元素的总花费需要减去这个花费这个元素的值
    result += s * (top_elem[1] - p_times)
    p_times += (top_elem[1] - p_times)
for c in board:  # 遍历所有未升级完全的士兵
    result += (c[1] - p_times) * c[0]
print(result)
